<?php
/* @var $this FriendlyLinkController */
/* @var $model FriendlyLink */
/* @var $form CActiveForm */
?>
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'category-form',
    // Please note: When you enable ajax validation, make sure the corresponding
    // controller action is handling ajax validation correctly.
    // There is a call to performAjaxValidation() commented in generated controller code.
    // See class documentation of CActiveForm for details on this.
    'htmlOptions'=>array('class'=>'form-horizontal', 'enctype'=>'multipart/form-data'),
    'enableAjaxValidation'=>false,
)); ?>

    <?php echo $form->errorSummary($model); ?>
    <div class="form-group">
        <?php echo $form->labelEx($model,'name', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form->textField($model,'name',array('size'=>11,'maxlength'=>11,'class'=>'form-control')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'image', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form->fileField($model,'image',array('size'=>11,'maxlength'=>11,'class'=>'form-control')); ?>
        </div>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($model,'url', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form ->textField( $model , 'url', array('class'=>'form-control'));?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'sort', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form->textField($model,'sort',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'type', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form->dropDownList($model,'type',Constants::getLinkTypeItems(),array('class'=>'form-control')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'from_url', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form->textField($model,'from_url',array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'expire_at', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <div class="input-group date">
                <div class="input-group-addon">
                    <i class="fa fa-calendar"></i>
                </div>
                <?php echo $form ->textField( $model , 'expire_at',array('class'=>'form-control','id'=>'expire_at'));?>
            </div>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'target', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form ->radioButtonList( $model , 'target' ,array('_blank'=>'是' , '_self'=>'否' ), array('separator'=>'&nbsp;&nbsp;', 'class'=>''/*'template'=>'<span class="minimal-blue">{input} {label}</span>'*/));?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model,'status', array('class'=>'col-sm-2 control-label'));?>
        <div class="col-sm-10">
            <?php echo $form ->radioButtonList( $model , 'status' ,array('1'=>'是' , '0'=>'否' ), array('separator'=>'&nbsp;&nbsp;', 'class'=>''/*'template'=>'<span class="minimal-blue">{input} {label}</span>'*/));?>
        </div>
    </div>

    <div class="hr hr-18 dotted"></div>
    <div class="clearfix">
        <div class="col-md-offset-2 col-md-10">
            <button class="btn btn-white btn-info btn-round" type="submit"><i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>保存</button>
            &nbsp;
            <button class="btn btn-white btn-default btn-round" type="reset"><i class="ace-icon fa fa-times red2"></i>取消</button>
        </div>
    </div>
<?php $this->endWidget(); ?>